#include <iostream>
#include <algorithm>
using namespace std;

int main()
{
    string s;
    cin>>s;
    enum alpha{G,P,L,T};
    char al[4]{'G','P','L','T'};
    int nums[4]{0};
    for (char c:s)
    {
        if (c=='G'||c=='g')
            nums[G]+=1;
        else if (c=='P'||c=='p')
            nums[P]+=1;
        else if (c=='L'||c=='l')
            nums[L]+=1;
        else if (c=='T'||c=='t')
            nums[T]+=1;
    }
    while (1)
    {
        if (nums[0]==0&&nums[1]==0&&nums[2]==0&&nums[3]==0)
            break;
        for (int i=0;i<4;i++)
        {
            if (nums[i]!=0)
            {
                cout<<al[i];
                nums[i]--;
            }
        }
    }
}